<template>
  <detail-list  size="small" :col="3" class="detail-layout">
    <detail-list-item term="姓名">{{teacherBaseInfo.realname}}</detail-list-item>
    <detail-list-item term="年龄">{{ this.getAge }}</detail-list-item>
    <detail-list-item term="性别">{{teacherBaseInfo.sex_dictText}}</detail-list-item>
    <detail-list-item term="教师类型">{{teacherBaseInfo.teacherType_dictText}}</detail-list-item>
    <detail-list-item term="部门">{{teacherBaseInfo.orgCode_dictText}}</detail-list-item>
    <detail-list-item term="兼课部门">{{ teacherBaseInfo.teachingOrgCode_dictText }}</detail-list-item>
    <detail-list-item term="职称">{{ teacherBaseInfo.titleRank_dictText }}</detail-list-item>
    <detail-list-item term="职务">{{ teacherBaseInfo.position_dictText }}</detail-list-item>
    <detail-list-item term="双师型教师">{{teacherBaseInfo.dualQualification_dictText}}</detail-list-item>
  </detail-list>
</template>

<script>
import DetailList from '@/components/tools/DetailList'
import moment from 'moment'
const DetailListItem = DetailList.Item
export default {
  name: 'TeacherBaseInfoV1',
  props: {
    teacherBaseInfo: {
      type: Object,
      required: true
    },
  },
  computed: {
    getAge(){
      let birthday = moment(this.teacherBaseInfo.birthday).format('YYYY-MM-DD')
      let age = moment().diff(birthday, 'years')
      return age
    },
  },
  data(){
    return {
      currentDate:'',
    }
  },
  components:{
    DetailList,DetailListItem
  },
}
</script>

<style scoped>

</style>